package com.cgc.venus.server.ci.inter;

import com.cgc.venus.server.ci.model.entity.PipelinePara;
import com.cgc.venus.server.ci.model.vo.*;
import com.github.pagehelper.PageInfo;
import com.offbytwo.jenkins.model.BuildWithDetails;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * Created by 业哥 on 2018/11/13.
 */
public interface CIService {
    public void createJob(String jobName, String configXml) throws Exception;
    public void updateJob(String jobName, String configXml) throws Exception;
    public void deleteJob(String jobName) throws Exception;
    public int buildJob(String jobName) throws Exception;
    public int buildJob(String jobName, Map<String, String> params) throws Exception;
    public BuildWithDetails getBuildJobDetailByLastTime(String jobName) throws Exception;
    public BuildWithDetails getBuildJobDetailByNumber(String jobName, int Number) throws Exception;


    public PageInfo<PipelineVO> findPipelinesByKey(String key,String namespace,int pageNum, int rowNum)throws Exception;
    public PipelineVO findPipelineById(String id)throws Exception;
    public PipelineVO findPipelineByIdWithNoDetail(String id)throws Exception;
    public int addPipeline(PipelineVO pipelineVO)throws Exception;
    public int updatePipeline(PipelineVO pipelineVO)throws Exception;
    public int deletePipeline(String id,String pipelineNameEn)throws Exception;
    public int buildPipeline(String id,String pipelineNameEn,List<PipelineParaVO> pipelineParaVOs) throws Exception;
    public PipelineBuildLogVO findPipelineBuildLog(String id,String pipelineNameEn,int buildNum) throws Exception;
    public List<PipelineBuildLogVO> findPipelineBuildLogs(String id,String pipelineNameEn,int buildNum) throws Exception;

    public List<JdkVO> getJdkConfig()throws Exception;
    public List<PipelineParaVO> findPipelineParaByPipelineId(String pipelineId)throws Exception;
}
